package string;

/**o铺雷氏奥
 * String replaceAll(String regex,String replacement)
 * 将当前字符串中满足正则表达式(regex)的部分替换为给定内容(replacement)
 */
public class ReplaceAllDemo {
    public static void main(String[] args) {
        String str = "sdj245gbhuinoff245";
        str = str.replaceAll("[0-9]+", "#QWERTYU#");
        System.out.println(str);

        String str1 = "(sb|妈|滚|草|爹)";
        String w = "我是你爹,妈,他妈的sb,你滚,我草";
        w = w.replaceAll(str1,"***");
        System.out.println(w);

    }
}
